import { getData } from './request';

export default async (store) => {
  // consName type
  const consName = store.state.consName,
        filed = store.state.field,
        data = await getData(consName, filed);
  if (data.error_code) {
    store.commit('setErrorCode', data.error_code);
    return;
  }
  store.commit('setData', data)
}